﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RockCompany.Common.Lib;
using RockCompany.Common.Constant;
using System.Data;

namespace RockCompany.Master.Model
{
    public class SC02FormModel : CommonModel
    {
        public SC02FormModel()
        {
            dbConnector = new DBConnector();
        }

        public bool checkLogin(string sUserName, string sPassword)
        {
            string sClause = "USERNAME = @USERNAME AND PASSWORD = @PASSWORD";
            Dictionary<string, object> pv = new Dictionary<string, object>();
            pv.Add("@USERNAME", sUserName);
            pv.Add("@PASSWORD", sPassword);
            DataTable tempDB = selectWithWhereClause("USERS", sClause, pv);
            int res = 0;
            if(tempDB!=null)
                res= tempDB.Rows.Count;
            return res > 0;
        }
    }
}
